package com.teatrace.service.storage;

import java.io.Serializable;
import java.util.List;

public interface StorageService {

	public void add(Object object) throws Exception;
	
	public void deleteById(Class<?> clazz,Serializable pk) throws Exception;

	public <T> Object loadById(Class<T> clazz, Serializable pk) throws Exception;
	
	public void update(Object obj) throws Exception;
	
	public <T> List<T> listByPage(Class<T> clazz, int page) throws Exception;
	
	public <T> Object getById(Class<T> clazz, Serializable pk) throws Exception;

	/**
	 * 条件分页查询
	 * @param <T>
	 * @param clazz
	 * @param page
	 * @param object
	 * @return
	 * @throws Exception
	 */
	public <T> List<T> listByCriteria(Class<T> clazz, int page,String parameter,Object value) throws Exception;
	
	/**
	 * 多条件查询
	 * @param <T>
	 * @param clazz
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public <T> List<T> listByCriteria(Class<T> clazz,final int page ,String pk,Object pkValue,String parameter,Object value) throws Exception;

}
